<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>六西格玛知识管理</title>
<link href="<?php echo $this->baseUrl ?>/public/style/style.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->baseUrl ?>/public/style/form-check.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->baseUrl ?>/public/style/daterangepicker.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->baseUrl ?>/public/style/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->baseUrl ?>/public/style/thickbox.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/jquery.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/daterangepicker.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/jquery-ui.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/thickbox-compressed.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/jQuery.FormValidator.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/fckeditor/fckeditor.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/jQuery.FormValidator.js"></script>

<script type="text/javascript">
	function CheckForm() {
		return $("#form1").FormValidate();
	}
	$(document).ready(function() {
		$("#form1").SetValidateSettings({});
		$("#title").SetValidateSettings({
			FormValidate: {
				Empty: {
					Value: true,
					Message: "项目名称不能为空"
				}
			},
			Message: {
				Text: {
					Success: "",
					Error: "必须输入项目名称！"
				},
				MessageSpaceHolderID: "TipTitle"
			}
		});
		/*$("#teacher_id_hover").SetValidateSettings({
			FormValidate: {
				Empty: {
					Value: true,
					Message: "所属教师不能为空"
				}
			},
			Message: {
				Text: {
					Success: "",
					Error: "必须输入所属教师！"
				},
				MessageSpaceHolderID: "TipTeacher"
			}
		});
		$("#class_id_hover").SetValidateSettings({
			FormValidate: {
				Empty: {
					Value: true,
					Message: "所属班级不能为空"
				}
			},
			Message: {
				Text: {
					Success: "",
					Error: "必须输入所属班级！"
				},
				MessageSpaceHolderID: "TipClass"
			}
		});
		$("#student_id_hover").SetValidateSettings({
			FormValidate: {
				Empty: {
					Value: true,
					Message: "所属学生不能为空"
				}
			},
			Message: {
				Text: {
					Success: "",
					Error: "必须输入所属学生！"
				},
				MessageSpaceHolderID: "TipStudent"
			}
		});*/

	});
</script>
<script type="text/javascript">	
	$(function(){
		  $('#start_time').daterangepicker({
				closeOnSelect:true, 
				dateFormat:'yy-m-d', 
				presets:{specificDate: '选择日期'}, 
				presetRanges:[{text: '选择今天', dateStart: 'today', dateEnd: 'today'}],
				rangeSplitter: '--',
				datepickerOptions: {
					changeMonth: true, 
					changeYear: true, 
					monthNamesShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"], 
					yearRange:"-50:+50",
					dayNamesMin:["日","一","二","三","四","五","六"]
					}, 
				posX:$('#start_time').offset().left + 180,
				posY:$('#start_time').offset().top,
				earliestDate: Date.parse('-80years'),
				latestDate: Date.parse('+15years')
				});
	 });
</script>
</head>

<body>
<!--头部-->
<?php echo $this->partial('common/header.html', array('template'=>$this->template, 'baseUrl'=>$this->baseUrl)) ?>

<!--主体-->
<div class="main-box" id="mainBox">
    <div class="third-menu">
        <?php echo $this->partial('common/operation.html', array('template'=>$this->template, 'baseUrl'=>$this->baseUrl)) ?>
        <div class="menu-title"><span class="icon"></span>项目添加</div>
    </div>
    
    <div class="separate-line"></div>
    
    <div class="main-form">
    <form name="form1" id="form1" method="post" action="<?php echo $this->baseUrl ?>/project/add">
        <p>
            <label for="title">项目标题：</label>
            <input name="title" type="text" class="input-text" id="title" />
            <span id="TipTitle" class="Show"></span>
        </p>
        <input type="hidden" name="hover_type" id="hover_type" value="teacher" />
        <p>
        	<label for="teacher_id">所属教师：</label>
            <input name="teacher_name" type="text" class="input-text" id="teacher_name_hover" disabled="disabled" />
            <input name="teacher_id" type="hidden" id="teacher_id_hover" />
            <a href="<?php echo $this->baseUrl ?>/teacher/add" class="color-button button" target="_blank">添加教师</a>
            <a href="<?php echo $this->baseUrl ?>/teacher/hover?keepThis=true&TB_iframe=true&height=360&width=330" class="button thickbox">选择教师</a>
            <span id="TipTeacher" class="Show"></span>
        </p>
        <p>
        	<label for="class_id">所属班级：</label>
            <input name="class_name" type="text" class="input-text" id="class_name_hover" disabled="disabled" />
            <input name="class_id" type="hidden" id="class_id_hover" />
            <a href="<?php echo $this->baseUrl ?>/class/add" class="color-button button" target="_blank">添加班级</a>
            <a href="<?php echo $this->baseUrl ?>/class/hover?keepThis=true&TB_iframe=true&height=360&width=330" class="button thickbox">选择班级</a>
            <span id="TipClass" class="Show"></span>
        </p>
        <p>
        	<label for="student_id">所属学生：</label>
            <input name="student_name" type="text" class="input-text" id="student_name_hover" disabled="disabled" />
            <input name="student_id" type="hidden" id="student_id_hover" />
            <a href="<?php echo $this->baseUrl ?>/student/add" class="color-button button" target="_blank">添加学生</a>
            <a href="<?php echo $this->baseUrl ?>/student/hover?keepThis=true&TB_iframe=true&height=360&width=330" class="button thickbox">选择学生</a>
            <span id="TipStudent" class="Show"></span>
        </p>
        <p>
            <label for="start_time">项目日期：</label>
            <input id="start_time" name="start_time" type="text" class="input-text" value="<?php echo date('Y-n-j', time()); ?>" />
            <span id="TipProjectTime" class="Show"></span>
        </p>
            
        <p>
        	<label for="category">项目类型：</label>
        	<select name="category" class="input-text" id="pid_select">
            	<?php foreach ($this->conf->projectType as $key => $val): ?>
                    <option value="<?php echo $key ?>"><?php echo $val; ?></option>
                <?php endforeach; ?>
            </select>
        </p>
        <p>
        	<label for="kind">项目分类：</label>
        	<select name="kind" class="input-text" id="pid_select">
            	<?php foreach ($this->conf->projectKind as $key => $val): ?>
                    <option value="<?php echo $key ?>"><?php echo $val; ?></option>
                <?php endforeach; ?>
            </select>
        </p>
        <p>
        	<label for="income">项目收益：</label>
            <input name="income" type="text" class="input-text" />
        </p>
        
        <input name="pid" type="hidden" id="project_id_hover" value="0" />
        <!--p id="p_pid" style="display:none">
        	<label for="pid">上级黑带项目：</label>
            <input name="pid_name" type="text" class="input-text" id="project_name_hover"  />
            <input name="pid" type="hidden" id="project_id_hover" value="0" />
            <a href="<?php echo $this->baseUrl ?>/project/add" class="color-button button" target="_blank">添加项目</a>
            <a href="<?php echo $this->baseUrl ?>/project/hover?pid=0&keepThis=true&TB_iframe=true&height=360&width=330" class="button thickbox">选择项目</a>
        </p-->
        <p>
        	<label for="key">关键字：</label>
            <input name="key_word" type="text" class="input-text" id="key" />
        </p>
        <p id="tag_add" style="display:none">

        </p>
        <p><label for="summary">项目摘要：</label><textarea name="summary" class="input-textarea" ></textarea></p>
        <p><label>&nbsp;</label><input type="submit" class="button" style="margin-left:0" value="提 交" /></p>
    </form>
    </div>
    <!--div class="main-form">
        <form action="<?php echo $this->baseUrl;?>/excel/upload" method="post" enctype="multipart/form-data" />
            <input type="hidden" name="model" value="project" id="model" />
            <p>	
                <label>&nbsp;</label>
                <input type="file" name="files" />
                <input type="submit" class="button" value="批量上传" />
            </p>
        </form>
    </div-->
    
    <script>
    $(document).ready(function(){
        $("#pid_select").change(function(){
            if ($(this).val() == 0) {
                $("#p_pid").css('display', 'none');
                $("#pid").value = 0;
            }else{
                $("#p_pid").css('display', 'block');
            }
        });
        $("#title").change(function(){
            var title = $(this).val();
		   $.ajax({
			   type: "POST",
			   url: "<?php echo $this->baseUrl;?>/split/split",
			   data: "title="+title,
			   success: function(msg){
				 $("#key").val(msg);
			   }
			});
        });
    });
    </script>
    
    
    
</div>










<!--底部-->
<?php echo $this->partial('common/footer.html') ?>
</body>
</html>